package com.yxt.admin.controller;

import com.yxt.admin.entity.SysConfig;
import com.yxt.admin.service.ISysConfigService;
import com.yxt.admin.utils.SecurityUtils;
import com.yxt.common.annotation.Log;
import com.yxt.common.enums.BusinessType;
import com.yxt.common.utils.ajax.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 参数配置 信息操作处理
 * 
 */
@RestController
@RequestMapping("/admin/config")
public class SysConfigController
{
    @Autowired
    private ISysConfigService configService;


    /**
     * 根据参数编号获取详细信息
     */
    @GetMapping(value = "/{configId}")
    public R getInfo(@PathVariable Long configId)
    {
        return R.ok().put("data",configService.selectConfigById(configId));
    }

    /**
     * 根据参数键名查询参数值
     */
    @GetMapping(value = "/configKey/{configKey}")
    public R getConfigKey(@PathVariable String configKey)
    {
        return R.ok().put("data",configService.selectConfigByKey(configKey));
    }
}
